package com.xoa.dev.flowStatistics.controller;

import com.xoa.dev.flowStatistics.service.StatisticsService;
import com.xoa.util.common.wrapper.BaseWrappers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

/*
* 创建作者:   李 帅 帅
* 创建日期:   14:59 2019/9/2 0002
* 方法介绍:   相关流程数据查询进行列表控件展示
* 参数说明:   * @param null
* @return
        */
@Controller
@RequestMapping("/StatisticsFlowRun")
public class StatisticsController {
    @Autowired
    private StatisticsService statisticsService;
    @RequestMapping("/queryFlowRun")
    @ResponseBody
    public BaseWrappers queryFlowRunList(@RequestParam(name = "page", defaultValue = "1") Integer page,
                                         @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
                                         @RequestParam(name = "useFlag", defaultValue = "true") Boolean useFlag){
        return statisticsService.queryFlowRunList(page,pageSize,useFlag);
    }
    //图形化统计分析
    @RequestMapping("/queryFlowRunShow")
    @ResponseBody
    public ModelAndView queryFlowRunsShow(){
        ModelAndView mav = new ModelAndView("app/workflow/flowRun/queryFlowRuns");
        return mav;
    }
    //图形化统计分析
    @RequestMapping("/queryFlowRuns")
    public ModelAndView queryFlowRuns(){
        ModelAndView mav = new ModelAndView("app/workflow/flowRun/queryFlowRunss");
        return mav;
    }
    //图形化统计分析
    @RequestMapping("/queryFlowRunss")
    @ResponseBody
    public Map queryFlowRunss(){
        return statisticsService.queryFlowRuns();
    }
    //图形化统计分析
    @RequestMapping("/echarts")
    public ModelAndView echarts(){
        ModelAndView mav = new ModelAndView("app/workflow/flowRun/echarts");
        return mav;
    }
}
